<html>
<head>
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Line chart with different colors above a certain point</title>
    
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    
    <meta name="description" content="A Line chart with different colors above a certain point. It uses a filled range chart to achieve this effect." />
     
</head>
<body>

    <h1>A Line chart with different colors above a certain point</h1>
    
    <p>
        A Line chart with different colors above a certain point. It uses a filled range chart to achieve this effect.
    </p>

    <canvas id="cvs" width="600" height="250">[No canvas support]</canvas>

    <script>
        $(document).ready(function ()
        {
            var d1  = [1,4,8,5,2,3,6,5,15,16,12,13,18,19,15,16];
            var d2  = [];
            
            // Create the data
            for (var i=0; i<d1.length; i+=1) {
                 d1[i] = d1[i] - 0.2; // The +/- 0.2 determines the width of the line
                 d2[i] = d1[i] + 0.2;
            }

        
            var line = new RGraph.Line({
                id: 'cvs',
                data: [d1, d2],
                options: {
                    background: {
                        grid: {
                            autofit: {
                                numhlines: 5,
                                numvlines: 15
                            }
                        }
                    },
                    filled: {
                        self: true,
                        range: {
                            self: true,
                            threshold: {
                                self: 10,
                                colors: ['red', 'blue']
                            }
                        }
                    },
                    labels: ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P'],
                    colors: ['transparent', 'transparent'],
                    numxticks: 15,
                    tickmarks: null
                }
            }).draw()
        })
    </script>

    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>

